lg.jqtouch	= {
	addNav:function(id) {
		if(lg.development) {
			return;
		}
		
		var page	= $('#'+id+' > .toolbar > h1');
		var back	= $('#'+id+' > .toolbar > .back');
		var left	= $('#'+id+' > .toolbar > .left');
		var right	= $('#'+id+' > .toolbar > .right');
		var obj		= {};
		
		//Hide jQTouch HTML toolbar
		$('#'+id+' > .toolbar').hide();
		
		obj.title	= page.html();
		obj.desc	= page.attr('alt');
		
		if(back.length == 0) {
			obj.hideBack	= 'true';
		} else {
			obj.hideBack	= 'false';
		}
		
		if(left.length == 1) {
			obj.leftTitle	= left.html();
		}
		
		if(right.length == 1) {
			obj.rightTitle	= right.html();
		}
		
		if(obj.title) {
			//Create native toolbar
			lg.navigation.add(obj);
		}
	}
};


lg.bind('lg_init', initLiquidGear);
	
function initLiquidGear() {
	lg.ui	= $.jQTouch({fullscreen:true, fixedViewport:true});
	
	$('ul li a').click(function(e) {
		var link	= $(this);
		var href	= link.attr('href');
		
		if(href.length > 1 && href.indexOf('#') >= 0) {
			var pageID	= href.replace(/\#/, '');
			lg.jqtouch.addNav(pageID);
		}
	});
	
	lg.bind('lg_navigation_back', jqGoBack);
	lg.trigger('lg_init_jqtouch');
}
function jqGoBack() {
	lg.ui.goBack();
}